import { Injectable, NestMiddleware } from '@nestjs/common';
import { Request, Response } from 'express';

@Injectable()
export class LoggerMiddleware implements NestMiddleware {
  // eslint-disable-next-line @typescript-eslint/ban-types
  use(req: Request, res: Response, next: Function) {
    console.log('Request...');
    next();
  }
}

@Injectable()
export class LoggerMiddleware2 {
  use(req, res, next) {
    console.log(req._parsedUrl.pathname)
    console.log(req.query)
    console.log('\n');
    next();
  }
}

export function LoggerMiddleware3(req: Request, res: Response, next: Function) {
  console.log(`logger3...`);
  next();
};
